<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="telephone=no" name="format-detection" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable = no"/>
<title>我的钱包</title>
<script src="__PUBLIC__/wap/js/flexible.js"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/wap/css/icons.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/wap/css/base.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/wap/css/member.css" />
</head>
<body class="wallet" ontouchstart="" onmouseover="">
<div class="head">
	<a href="javascript:history.go(-1);" class="md-close back">
		<i class="iconfont">&#xe617</i>
	</a>
	<h2>我的钱包</h2>
	<a href="{:U('Wap/Member/cashapply')}" class="rgtnav">
		提现 <i class="iconfont">&#xe638</i>
	</a>
</div>
<div class="page">
	<div class="type newbox">
		<ul >
			<li class="<if condition="$_GET['type'] neq 1">curr
				</if>
				" data="0">
				<a href="javascript:void(0);">
					<span class="icon"><i class="iconfont">&#xe638</i></span> 钱包
				</a>
			</li>
			<li class="<if condition="$_GET['type'] eq 1">curr
				</if>
				" data="1">
				<a href="javascript:void(0);">
					<span class="icon"><i class="iconfont">&#xe641</i></span> 积分
				</a>
			</li>
		</ul>
		<div class="clearfix">
		</div>
		<div class="banner">
			<div class="common-wrapper">
				<div class="userdiv clearfix fm-userdiv money_type_0"  
				
				<if condition="!empty($_GET['type'])">style="display:none"</if>
				>
				<div class="totalwallet" >
					<span>钱包总额：</span><span class="num green floatRgt" >¥{$data.balance_all}<span class="font40">元</span></span>
				</div>
			</div>
			<div class="userdiv clearfix fm-userdiv money_type_1"   
				
			<if condition="empty($_GET['type'])">style="display:none"</if>
			>
			<div class="totalwallet" >
				<span>积分总额：</span><span class="num green floatRgt">{$data.points|floor}<span class="font40">分</span></span>
			</div>
		</div>
	</div>
</div>
<div class="clearfix"></div>
</div>
<div class="type_order newbox2 col5">
	<ul class="floatLft ">
		<li class="order_all  on " data="all">
			<a href="javascript:void(0);">
				<span class="icon"><i class="iconfont">&#xe626</i></span> 全部
			</a>
		</li>
		<li data="store" class="order_store ">
			<a href="javascript:void(0);">
				<span class="icon"><i class="iconfont">&#xe61f</i></span> 店铺
			</a>
		</li>
		<li data="goods">
			<a href="javascript:void(0);">
				<span class="icon"><i class="iconfont">&#xe612</i></span> 商品
			</a>
		</li>
		<li  data="lottery" class="money_type_0 "
		<if condition="$_GET['type'] eq 1 "> style='display:none'</if>
		>
		<a href="javascript:void(0);">
			<span class="icon"><i class="iconfont">&#xe61a</i></span> 抽奖
		</a>
		</li>
		<li  data="cashapply" class="money_type_0 "
		<if condition="$_GET['type'] eq 1 "> style='display:none'</if>
		>
		<a href="javascript:void(0);">
			<span class="icon"><i class="iconfont">&#xe638</i></span> 提现
		</a>
		</li>
		<li data="refund" class="money_type_1 " <if condition="$_GET['type'] neq 1"> style='display:none'</if>>
			<a href="javascript:void(0);">
				<span class="icon"><i class="iconfont">&#xe642</i></span> 退款
			</a>
		</li>
		<li  data="other" class="money_type_1 "
		<if condition="$_GET['type'] neq 1"> style='display:none'</if>
		>
		<a href="javascript:void(0);">
			<span class="icon"><i class="iconfont">&#xe64d</i></span> 其他
		</a>
		</li>
	</ul>
	<div class="clearfix"></div>
</div>
<div id="fm-mizhi" class="newbox" >
	<ul class="more_html" id="more_html">
		<volist name="list" id="vo">
			<li  class="{$vo.type_order}">
				<div class="title"> {$vo.typename}
					<div class="pirce floatRgt num green font40"> {$vo.status}{$vo.money} </div>
				</div>
				<div class="time num"> {$vo.des}。{$vo.add_time} </div>
			</li>
		</volist>
	</ul>
</div>
<div class="loading">
	<div class="fm-footer-copyright get_more">
		<if condition="$count gt 10 && count($list) eq 10"> 加载更多
			<else/>
			无更多数据 </if>
	</div>
</div>
</div>

<!--end top-->
<include file="Public/footer_new" />
<include file="Public/wap_javascript"/>
<script type="text/javascript">
    var binding_is_check = 0;// 重复再次弹出 1是 0否
    var binding_page = 'member_wallet';// //当前页面名称 不可重复
</script>
<!--绑定-->
<include file="Public/binding_phone"/>
<!--绑定-->

<!--end top-->
<input type="hidden" name="p" value="2" />
<input type="hidden" name="type" value="{$_GET.type}" />
<input  type="hidden" name="type_order" value="">
<!--微信分享-->
<include file="Public/share_weixin" />
<script type="text/javascript">
	var type=$("input[name='type']").val();
   $(function(){
     $(".get_more").click(function(){
        get_more();
     });
      $(".type li").click(function(){
        var　__this=$(this);
        $('.type li').removeClass('curr');
        __this.addClass('curr');
        var type=__this.attr('data');
        $("input[name='p']").val(1);
        $("input[name='type']").val(type);
        if(type==1){
          $('.money_type_0').hide();
          $('.money_type_1').show();
			$('.order_all').click();
        }else{
          $('.money_type_1').hide();
          $('.money_type_0').show();
			$('.order_all').click();
        }
     });

	   //type_order 点击显隐
		$('.type_order li').click(function () {
			var type_order=$(this).attr('data');
			$('.type_order li').removeClass('on');
			$(this).addClass('on');
/*			if(type_order == 'all'){
				$('.more_html li').show();
			}else {
				$('.more_html li').hide();
				$('.more_html').find('.'+type_order).show();
			}*/
			$("input[name='type_order']").val(type_order);
			$("input[name='p']").val(1);
			$('.get_more').show();
			get_more();
/*			if(content){
				$('#fm-mizhi').show();
			}else {
				$('#fm-mizhi').hide();
			}*/
		});
   }); 
   function get_more(){
     var p=$("input[name='p']").val();
     var type=$("input[name='type']").val();
	 var type_order=$("input[name='type_order']").val();
      if(p==1){
          $('.more_html').html("");
        }
           $.ajax({ 
            url: "{:U('wap/member/wallet')}",
            type:'get',
            data: {p:p,type:type,type_order:type_order},
            dataType: 'json',
            success: function(data){
				//console.log(data);
               var con=1;
                 var option='';
              if(data){
                 $.each(data, function(i, value) {
                //this指向当前元素
                //i表示Array当前下标
                //value表示Array当前元素
                 option=option+'<li class="'+value.type_order+'">'
                   +' <div class="title">'+value.typename+'<div class="pirce floatRgt num green font40">'+value.status+value.money+'</div></div>'
                  +'  '
                   +' <div class="time num">'+value.des+'。'+value.add_time+'</div>'
                    +' </li>';
                    con++;
                 });
              }

              if(p==1){
                $('#more_html').html(option);
              }else{
                 $('#more_html').append(option);
              }
              $("input[name='p']").val(parseInt(p)+1);
              if(con<10){
                 $('.get_more').html('无更多数据');
				  $('.get_more').fadeOut(3000);
              }
				var content=$('.more_html').children('li').length;
				if(content == 0){
					$('#fm-mizhi').hide();
				}else {
					$('#fm-mizhi').show();
				}
            }
           });
   }
</script>
</body>
</html>